
function refund() {
    var refundType=   $("input[type='radio']:checked").val();
    if (refundType == null || refundType == '') {
        alert('请选择退款类型');
        return;
    }
    var serialNo = $('#serialNo').val();
    if (serialNo == null || serialNo == '') {
        alert('退款流水号不能为空');
        return;
    }
    var refundFee = $('#refundFee').val();

    document.getElementById('loadDiv').style.display = 'block';
    var predata = {"refundType": refundType,"serialNo": serialNo,"refundFee": refundFee};
    $.ajax({
        url: preUrl + "order/refund",
        type: "post",
        dataType: "json",
        data: predata,
        success: function (data) {
            if (typeof(data) == "undefined") {
                alert("访问服务器失败，请稍后重试");
            } else {
                if (data.resCode == "0000") {
                    alert("退款成功")
                } else if (data.resCode == '1000') {
                    alert(data.errInfo)
                } else {
                    alert("访问服务器失败，请稍后重试");
                }
            }
        },
        error: function (data) {
            alert("访问服务器失败，请稍后重试");
        }
    });

    document.getElementById('loadDiv').style.display = 'none';
}
